package com.esbi.projectwebsocket.collect.toJson;

import java.text.SimpleDateFormat;
import java.util.Date;

public class CurrentTimeMillis {
    public static void main(String[] args) {
        long l = System.currentTimeMillis();
        System.out.println(l);
        String s = String.valueOf(l);
        System.out.println(s);
        //一下是将其转换为具体的日期
        Date date = new Date(l);
        System.out.println(date);
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String format = simpleDateFormat.format(date);
        System.out.println("转换后的日期: " + format);
    }
}
